package com.jade.modules.media;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * 媒体资料本地服务。
 */
public interface MediaLocalService
{
    public CMediaItem uploadMedia(String type, String app, String contentType, String name, InputStream is,
                                  String remark)
            throws MediaException, IOException;

    public CMediaItem uploadMedia(String type, String app, File file, String remark)
            throws MediaException, IOException;

    public void downloadMedia(CMediaItem item, OutputStream os)
            throws MediaException, IOException;

    public void downloadMedia(CMediaItem item, OutputStream os, long offset, long length)
            throws MediaException, IOException;

    public File resizeImage(CMediaItem item, int width, int heigth)
            throws MediaException, IOException;

    public String getAccessUrl(String type, String url);

    public String getAccessUrl(CMediaItem item);
}
